function [residual, g1, g2, g3] = dynaremodel_KurmannSims_Part3_static(y, x, params)
%
% Status : Computes static model for Dynare
%
% Inputs : 
%   y         [M_.endo_nbr by 1] double    vector of endogenous variables in declaration order
%   x         [M_.exo_nbr by 1] double     vector of exogenous variables in declaration order
%   params    [M_.param_nbr by 1] double   vector of parameter values in declaration order
%
% Outputs:
%   residual  [M_.endo_nbr by 1] double    vector of residuals of the static model equations 
%                                          in order of declaration of the equations.
%                                          Dynare may prepend or append auxiliary equations, see M_.aux_vars
%   g1        [M_.endo_nbr by M_.endo_nbr] double    Jacobian matrix of the static model equations;
%                                                       columns: variables in declaration order
%                                                       rows: equations in order of declaration
%   g2        [M_.endo_nbr by (M_.endo_nbr)^2] double   Hessian matrix of the static model equations;
%                                                       columns: variables in declaration order
%                                                       rows: equations in order of declaration
%   g3        [M_.endo_nbr by (M_.endo_nbr)^3] double   Third derivatives matrix of the static model equations;
%                                                       columns: variables in declaration order
%                                                       rows: equations in order of declaration
%
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

residual = zeros( 52, 1);

%
% Model equations
%

T19 = exp(y(49))*params(15)/params(16)*exp(y(14))^params(16);
T34 = exp(y(49))*params(15)*exp(y(14))^(params(16)-1);
T42 = exp(y(4));
T49 = y(37)^(-1);
T61 = exp(y(6))/(exp(y(7))-exp(y(7))*params(12)*T49)-exp(y(6))*params(12)*params(3)/(exp(y(7))*y(37)-exp(y(7))*params(12));
T69 = exp(y(9));
T70 = T69^(-1);
T71 = T42*T49*params(3)*(1+y(8))*T70;
T105 = exp(y(17))/exp(y(18));
T106 = y(37)*T105;
T108 = T106-params(26);
T131 = params(20)/2*(exp(y(11))-1)^2;
T133 = params(21)/2;
T139 = T42*(exp(y(10))*exp(y(11))-params(19)*(exp(y(11))-1)-T131-T108*T133+T108*params(21)*T106);
T155 = exp(y(22))^params(10);
T165 = params(5)*params(11)^((-params(10))-1);
T168 = T165*y(37)^(1+params(10));
T169 = y(19)*T168;
T172 = T69^((-params(10))*params(7));
T173 = T169*T172;
T174 = T69^params(10);
T182 = params(11)^(-params(10));
T184 = y(37)^params(10);
T189 = T69^(params(7)*(1-params(10)));
T192 = T69^(params(10)-1);
T200 = exp(y(20))*params(10)/(params(10)-1)/exp(y(21));
T215 = T69^((-params(9))*params(8));
T216 = y(19)*y(37)*params(6)*T215;
T217 = T69^params(9);
T225 = T69^(params(8)*(1-params(9)));
T228 = T69^(params(9)-1);
T243 = exp(y(32))^params(2);
T246 = exp(y(23))^(1-params(2));
T255 = exp(y(31))*exp(y(28))*params(2)*exp(y(32))^(params(2)-1);
T262 = exp(y(23))^(-params(2));
T263 = T243*exp(y(31))*exp(y(28))*(1-params(2))*T262;
T272 = params(6)*T69^(params(9)*(-params(8)));
T296 = T69^(params(10)*(-params(7)));
T297 = T182*params(5)*T184*T296;
T302 = exp(y(22))^(1-params(10));
T307 = params(11)^(1-params(10));
T308 = params(5)*y(37)^(params(10)-1)*T307;
T309 = T189*T308;
T323 = exp(y(18))*T133*T108^2;
T329 = exp(y(37))^(-1);
lhs =y(1);
rhs =params(14)+T19+params(17)/params(18)*exp(y(13))^params(18);
residual(1)= lhs-rhs;
lhs =y(2);
rhs =T34;
residual(2)= lhs-rhs;
lhs =y(3);
rhs =params(17)*exp(y(13))^(params(18)-1);
residual(3)= lhs-rhs;
lhs =T42;
rhs =T61;
residual(4)= lhs-rhs;
lhs =T42;
rhs =T71;
residual(5)= lhs-rhs;
lhs =exp(y(10));
rhs =params(19)+params(20)*(exp(y(11))-1);
residual(6)= lhs-rhs;
lhs =y(3)*exp(y(6))*exp(y(12));
rhs =exp(y(14))*T42*exp(y(15));
residual(7)= lhs-rhs;
lhs =y(2)*exp(y(6))*exp(y(12));
rhs =exp(y(13))*T42*exp(y(15));
residual(8)= lhs-rhs;
lhs =T42;
rhs =exp(y(5))*exp(y(16))-T42*params(21)*T108;
residual(9)= lhs-rhs;
lhs =y(1)*exp(y(6))*exp(y(12));
rhs =T42*exp(y(14))*exp(y(13))*exp(y(15));
residual(10)= lhs-rhs;
lhs =exp(y(5));
rhs =T49*params(3)*(T139+exp(y(5))*(1-params(4)));
residual(11)= lhs-rhs;
lhs =y(19);
rhs =T42*T49*params(3)/T42;
residual(12)= lhs-rhs;
lhs =exp(y(20));
rhs =exp(y(15))*T155*exp(y(23))+exp(y(20))*T173*T174;
residual(13)= lhs-rhs;
lhs =exp(y(21));
rhs =T155*exp(y(23))+exp(y(21))*y(19)*params(5)*T182*T184*T189*T192;
residual(14)= lhs-rhs;
lhs =y(25);
rhs =T200;
residual(15)= lhs-rhs;
lhs =y(26);
rhs =exp(y(28))*exp(y(29))+y(26)*T216*T217;
residual(16)= lhs-rhs;
lhs =y(27);
rhs =exp(y(29))+y(27)*y(19)*y(37)*params(6)*T225*T228;
residual(17)= lhs-rhs;
lhs =y(30);
rhs =y(26)*params(9)/(params(9)-1)/y(27);
residual(18)= lhs-rhs;
lhs =exp(y(29));
rhs =exp(y(31))*T243*T246-params(62);
residual(19)= lhs-rhs;
lhs =exp(y(10));
rhs =T246*T255;
residual(20)= lhs-rhs;
lhs =exp(y(22));
rhs =T263;
residual(21)= lhs-rhs;
lhs =y(33);
rhs =(1-params(6))*y(30)^(-params(9))+y(33)*T217*T272;
residual(22)= lhs-rhs;
lhs =1;
rhs =(1-params(6))*y(30)^(1-params(9))+T228*params(6)*T225;
residual(23)= lhs-rhs;
lhs =exp(y(34));
rhs =exp(y(23))*y(35);
residual(24)= lhs-rhs;
lhs =y(35);
rhs =(1-params(5))*(y(25)/exp(y(22)))^(-params(10))+y(35)*T174*T297;
residual(25)= lhs-rhs;
lhs =T302;
rhs =(1-params(5))*y(25)^(1-params(10))+T302*T192*T309;
residual(26)= lhs-rhs;
lhs =exp(y(34));
rhs =exp(y(24))*exp(y(14))*exp(y(13));
residual(27)= lhs-rhs;
lhs =exp(y(32));
rhs =T49*exp(y(11))*exp(y(18));
residual(28)= lhs-rhs;
lhs =exp(y(29));
rhs =exp(y(7))+exp(y(17))+T49*T323+exp(y(18))*(params(19)*(exp(y(11))-1)+T131)*T329;
residual(29)= lhs-rhs;
lhs =exp(y(18));
rhs =exp(y(16))*exp(y(17))+T49*exp(y(18))*(1-params(4));
residual(30)= lhs-rhs;
lhs =y(8);
rhs =(1-params(28))*params(51)+y(8)*params(28)+(1-params(28))*(params(29)*(y(9)-log(params(13)))+params(30)*(log(y(37))-log(params(11))))+params(31)*x(2);
residual(31)= lhs-rhs;
lhs =y(36);
rhs =(1-params(33))*log(params(27))+y(36)*params(33)+params(38)*x(3);
residual(32)= lhs-rhs;
lhs =y(37);
rhs =exp(y(36))^(1/(1-params(2)));
residual(33)= lhs-rhs;
lhs =y(31);
rhs =y(31)*params(32)+params(37)*x(1);
residual(34)= lhs-rhs;
lhs =y(12);
rhs =(1-params(34))*log(params(23))+y(12)*params(34)+params(39)*x(4);
residual(35)= lhs-rhs;
lhs =y(16);
rhs =y(16)*params(35)+params(40)*x(5);
residual(36)= lhs-rhs;
lhs =y(6);
rhs =y(6)*params(36)+params(41)*x(6);
residual(37)= lhs-rhs;
residual(38) = y(38);
residual(39) = y(39);
lhs =y(40);
rhs =y(39)*params(59);
residual(40)= lhs-rhs;
lhs =y(51);
rhs =exp(y(22))*exp(y(23))/exp(y(29));
residual(41)= lhs-rhs;
lhs =y(41);
rhs =y(44)-(1-y(51))*y(46)-y(51)*y(47);
residual(42)= lhs-rhs;
lhs =y(42);
rhs =y(41)-y(38);
residual(43)= lhs-rhs;
lhs =y(43);
rhs =y(41)-y(40);
residual(44)= lhs-rhs;
lhs =y(44);
rhs =log(y(37));
residual(45)= lhs-rhs;
lhs =y(45);
rhs =log(y(37));
residual(46)= lhs-rhs;
lhs =y(46);
rhs =log(y(37));
residual(47)= lhs-rhs;
residual(48) = y(47);
lhs =y(48);
rhs =y(14)+y(24);
residual(49)= lhs-rhs;
lhs =y(49);
rhs =y(49)*params(61)+params(60)*x(7);
residual(50)= lhs-rhs;
lhs =y(50);
rhs =y(31)+y(36)-y(31);
residual(51)= lhs-rhs;
lhs =y(52);
rhs =x(3);
residual(52)= lhs-rhs;
if ~isreal(residual)
  residual = real(residual)+imag(residual).^2;
end
if nargout >= 2,
  g1 = zeros(52, 52);

  %
  % Jacobian matrix
  %

T472 = (-(T42*exp(y(14))*exp(y(13))*exp(y(15))));
T503 = T69*getPowerDeriv(T69,params(10),1);
T510 = T69*getPowerDeriv(T69,params(7)*(1-params(10)),1);
T513 = T69*getPowerDeriv(T69,params(10)-1,1);
T523 = T69*getPowerDeriv(T69,params(9),1);
T530 = T69*getPowerDeriv(T69,params(8)*(1-params(9)),1);
T533 = T69*getPowerDeriv(T69,params(9)-1,1);
T628 = y(37)*(-(exp(y(17))*exp(y(18))))/(exp(y(18))*exp(y(18)));
T674 = exp(y(22))*getPowerDeriv(exp(y(22)),params(10),1);
T684 = getPowerDeriv(y(25)/exp(y(22)),(-params(10)),1);
T689 = exp(y(22))*getPowerDeriv(exp(y(22)),1-params(10),1);
T695 = exp(y(23))*getPowerDeriv(exp(y(23)),1-params(2),1);
T738 = exp(y(32))*getPowerDeriv(exp(y(32)),params(2),1);
T756 = getPowerDeriv(y(37),(-1),1);
T797 = getPowerDeriv(y(37),params(10),1);
  g1(1,1)=1;
  g1(1,13)=(-(params(17)/params(18)*exp(y(13))*getPowerDeriv(exp(y(13)),params(18),1)));
  g1(1,14)=(-(exp(y(49))*params(15)/params(16)*exp(y(14))*getPowerDeriv(exp(y(14)),params(16),1)));
  g1(1,49)=(-T19);
  g1(2,2)=1;
  g1(2,14)=(-(exp(y(49))*params(15)*exp(y(14))*getPowerDeriv(exp(y(14)),params(16)-1,1)));
  g1(2,49)=(-T34);
  g1(3,3)=1;
  g1(3,13)=(-(params(17)*exp(y(13))*getPowerDeriv(exp(y(13)),params(18)-1,1)));
  g1(4,4)=T42;
  g1(4,6)=(-T61);
  g1(4,7)=(-((-(exp(y(6))*(exp(y(7))-exp(y(7))*params(12)*T49)))/((exp(y(7))-exp(y(7))*params(12)*T49)*(exp(y(7))-exp(y(7))*params(12)*T49))-(-(exp(y(6))*params(12)*params(3)*(exp(y(7))*y(37)-exp(y(7))*params(12))))/((exp(y(7))*y(37)-exp(y(7))*params(12))*(exp(y(7))*y(37)-exp(y(7))*params(12)))));
  g1(4,37)=(-((-(exp(y(6))*(-(exp(y(7))*params(12)*T756))))/((exp(y(7))-exp(y(7))*params(12)*T49)*(exp(y(7))-exp(y(7))*params(12)*T49))-(-(exp(y(7))*exp(y(6))*params(12)*params(3)))/((exp(y(7))*y(37)-exp(y(7))*params(12))*(exp(y(7))*y(37)-exp(y(7))*params(12)))));
  g1(5,4)=T42-T71;
  g1(5,8)=(-(T70*T42*T49*params(3)));
  g1(5,9)=(-(T42*T49*params(3)*(1+y(8))*T69*getPowerDeriv(T69,(-1),1)));
  g1(5,37)=(-(T70*T42*params(3)*(1+y(8))*T756));
  g1(6,10)=exp(y(10));
  g1(6,11)=(-(params(20)*exp(y(11))));
  g1(7,3)=exp(y(6))*exp(y(12));
  g1(7,4)=(-(exp(y(14))*T42*exp(y(15))));
  g1(7,6)=y(3)*exp(y(6))*exp(y(12));
  g1(7,12)=y(3)*exp(y(6))*exp(y(12));
  g1(7,14)=(-(exp(y(14))*T42*exp(y(15))));
  g1(7,15)=(-(exp(y(14))*T42*exp(y(15))));
  g1(8,2)=exp(y(6))*exp(y(12));
  g1(8,4)=(-(exp(y(13))*T42*exp(y(15))));
  g1(8,6)=y(2)*exp(y(6))*exp(y(12));
  g1(8,12)=y(2)*exp(y(6))*exp(y(12));
  g1(8,13)=(-(exp(y(13))*T42*exp(y(15))));
  g1(8,15)=(-(exp(y(13))*T42*exp(y(15))));
  g1(9,4)=T42-(-(T42*params(21)*T108));
  g1(9,5)=(-(exp(y(5))*exp(y(16))));
  g1(9,16)=(-(exp(y(5))*exp(y(16))));
  g1(9,17)=T42*params(21)*T106;
  g1(9,18)=T42*params(21)*T628;
  g1(9,37)=T42*params(21)*T105;
  g1(10,1)=exp(y(6))*exp(y(12));
  g1(10,4)=T472;
  g1(10,6)=y(1)*exp(y(6))*exp(y(12));
  g1(10,12)=y(1)*exp(y(6))*exp(y(12));
  g1(10,13)=T472;
  g1(10,14)=T472;
  g1(10,15)=T472;
  g1(11,4)=(-(T49*params(3)*T139));
  g1(11,5)=exp(y(5))-T49*params(3)*exp(y(5))*(1-params(4));
  g1(11,10)=(-(T49*params(3)*T42*exp(y(10))*exp(y(11))));
  g1(11,11)=(-(T49*params(3)*T42*(exp(y(10))*exp(y(11))-params(19)*exp(y(11))-params(20)/2*exp(y(11))*2*(exp(y(11))-1))));
  g1(11,17)=(-(T49*params(3)*T42*((-(T106*T133))+T108*params(21)*T106+T106*params(21)*T106)));
  g1(11,18)=(-(T49*params(3)*T42*((-(T133*T628))+params(21)*T106*T628+T108*params(21)*T628)));
  g1(11,37)=(-((T139+exp(y(5))*(1-params(4)))*params(3)*T756+T49*params(3)*T42*((-(T105*T133))+T105*params(21)*T106+T108*params(21)*T105)));
  g1(12,19)=1;
  g1(12,37)=(-(T42*params(3)*T756/T42));
  g1(13,9)=(-(exp(y(20))*(T174*T169*T69*getPowerDeriv(T69,(-params(10))*params(7),1)+T173*T503)));
  g1(13,15)=(-(exp(y(15))*T155*exp(y(23))));
  g1(13,19)=(-(exp(y(20))*T174*T168*T172));
  g1(13,20)=exp(y(20))-exp(y(20))*T173*T174;
  g1(13,22)=(-(exp(y(23))*exp(y(15))*T674));
  g1(13,23)=(-(exp(y(15))*T155*exp(y(23))));
  g1(13,37)=(-(exp(y(20))*T174*T172*y(19)*T165*getPowerDeriv(y(37),1+params(10),1)));
  g1(14,9)=(-(exp(y(21))*(T192*y(19)*params(5)*T182*T184*T510+y(19)*params(5)*T182*T184*T189*T513)));
  g1(14,19)=(-(exp(y(21))*T192*params(5)*T182*T184*T189));
  g1(14,21)=exp(y(21))-exp(y(21))*y(19)*params(5)*T182*T184*T189*T192;
  g1(14,22)=(-(exp(y(23))*T674));
  g1(14,23)=(-(T155*exp(y(23))));
  g1(14,37)=(-(exp(y(21))*T192*T189*y(19)*params(5)*T182*T797));
  g1(15,20)=(-T200);
  g1(15,21)=(-((-(exp(y(21))*exp(y(20))*params(10)/(params(10)-1)))/(exp(y(21))*exp(y(21)))));
  g1(15,25)=1;
  g1(16,9)=(-(y(26)*(T217*y(19)*y(37)*params(6)*T69*getPowerDeriv(T69,(-params(9))*params(8),1)+T216*T523)));
  g1(16,19)=(-(y(26)*T217*y(37)*params(6)*T215));
  g1(16,26)=1-T216*T217;
  g1(16,28)=(-(exp(y(28))*exp(y(29))));
  g1(16,29)=(-(exp(y(28))*exp(y(29))));
  g1(16,37)=(-(y(26)*T217*T215*y(19)*params(6)));
  g1(17,9)=(-(y(27)*(T228*y(19)*y(37)*params(6)*T530+y(19)*y(37)*params(6)*T225*T533)));
  g1(17,19)=(-(y(27)*T228*y(37)*params(6)*T225));
  g1(17,27)=1-y(19)*y(37)*params(6)*T225*T228;
  g1(17,29)=(-exp(y(29)));
  g1(17,37)=(-(y(27)*T228*T225*y(19)*params(6)));
  g1(18,26)=(-(params(9)/(params(9)-1)/y(27)));
  g1(18,27)=(-((-(y(26)*params(9)/(params(9)-1)))/(y(27)*y(27))));
  g1(18,30)=1;
  g1(19,23)=(-(exp(y(31))*T243*T695));
  g1(19,29)=exp(y(29));
  g1(19,31)=(-(exp(y(31))*T243*T246));
  g1(19,32)=(-(T246*exp(y(31))*T738));
  g1(20,10)=exp(y(10));
  g1(20,23)=(-(T255*T695));
  g1(20,28)=(-(T246*T255));
  g1(20,31)=(-(T246*T255));
  g1(20,32)=(-(T246*exp(y(31))*exp(y(28))*params(2)*exp(y(32))*getPowerDeriv(exp(y(32)),params(2)-1,1)));
  g1(21,22)=exp(y(22));
  g1(21,23)=(-(T243*exp(y(31))*exp(y(28))*(1-params(2))*exp(y(23))*getPowerDeriv(exp(y(23)),(-params(2)),1)));
  g1(21,28)=(-T263);
  g1(21,31)=(-T263);
  g1(21,32)=(-(T262*exp(y(31))*exp(y(28))*(1-params(2))*T738));
  g1(22,9)=(-(y(33)*(T272*T523+T217*params(6)*T69*getPowerDeriv(T69,params(9)*(-params(8)),1))));
  g1(22,30)=(-((1-params(6))*getPowerDeriv(y(30),(-params(9)),1)));
  g1(22,33)=1-T217*T272;
  g1(23,9)=(-(params(6)*T225*T533+T228*params(6)*T530));
  g1(23,30)=(-((1-params(6))*getPowerDeriv(y(30),1-params(9),1)));
  g1(24,23)=(-(exp(y(23))*y(35)));
  g1(24,34)=exp(y(34));
  g1(24,35)=(-exp(y(23)));
  g1(25,9)=(-(y(35)*(T297*T503+T174*T182*params(5)*T184*T69*getPowerDeriv(T69,params(10)*(-params(7)),1))));
  g1(25,22)=(-((1-params(5))*(-(exp(y(22))*y(25)))/(exp(y(22))*exp(y(22)))*T684));
  g1(25,25)=(-((1-params(5))*T684*1/exp(y(22))));
  g1(25,35)=1-T174*T297;
  g1(25,37)=(-(y(35)*T174*T296*T182*params(5)*T797));
  g1(26,9)=(-(T302*(T309*T513+T192*T308*T510)));
  g1(26,22)=T689-T192*T309*T689;
  g1(26,25)=(-((1-params(5))*getPowerDeriv(y(25),1-params(10),1)));
  g1(26,37)=(-(T302*T192*T189*T307*params(5)*getPowerDeriv(y(37),params(10)-1,1)));
  g1(27,13)=(-(exp(y(24))*exp(y(14))*exp(y(13))));
  g1(27,14)=(-(exp(y(24))*exp(y(14))*exp(y(13))));
  g1(27,24)=(-(exp(y(24))*exp(y(14))*exp(y(13))));
  g1(27,34)=exp(y(34));
  g1(28,11)=(-(T49*exp(y(11))*exp(y(18))));
  g1(28,18)=(-(T49*exp(y(11))*exp(y(18))));
  g1(28,32)=exp(y(32));
  g1(28,37)=(-(exp(y(11))*exp(y(18))*T756));
  g1(29,7)=(-exp(y(7)));
  g1(29,11)=(-(T329*exp(y(18))*(params(19)*exp(y(11))+params(20)/2*exp(y(11))*2*(exp(y(11))-1))));
  g1(29,17)=(-(exp(y(17))+T49*exp(y(18))*T133*T106*2*T108));
  g1(29,18)=(-(exp(y(18))*(params(19)*(exp(y(11))-1)+T131)*T329+T49*(T323+exp(y(18))*T133*2*T108*T628)));
  g1(29,29)=exp(y(29));
  g1(29,37)=(-(T323*T756+T49*exp(y(18))*T133*T105*2*T108+exp(y(18))*(params(19)*(exp(y(11))-1)+T131)*exp(y(37))*getPowerDeriv(exp(y(37)),(-1),1)));
  g1(30,16)=(-(exp(y(16))*exp(y(17))));
  g1(30,17)=(-(exp(y(16))*exp(y(17))));
  g1(30,18)=exp(y(18))-T49*exp(y(18))*(1-params(4));
  g1(30,37)=(-(exp(y(18))*(1-params(4))*T756));
  g1(31,8)=1-params(28);
  g1(31,9)=(-((1-params(28))*params(29)));
  g1(31,37)=(-((1-params(28))*params(30)*1/y(37)));
  g1(32,36)=1-params(33);
  g1(33,36)=(-(exp(y(36))*getPowerDeriv(exp(y(36)),1/(1-params(2)),1)));
  g1(33,37)=1;
  g1(34,31)=1-params(32);
  g1(35,12)=1-params(34);
  g1(36,16)=1-params(35);
  g1(37,6)=1-params(36);
  g1(38,38)=1;
  g1(39,39)=1;
  g1(40,39)=(-params(59));
  g1(40,40)=1;
  g1(41,22)=(-(exp(y(22))*exp(y(23))/exp(y(29))));
  g1(41,23)=(-(exp(y(22))*exp(y(23))/exp(y(29))));
  g1(41,29)=(-((-(exp(y(29))*exp(y(22))*exp(y(23))))/(exp(y(29))*exp(y(29)))));
  g1(41,51)=1;
  g1(42,41)=1;
  g1(42,44)=(-1);
  g1(42,46)=1-y(51);
  g1(42,47)=y(51);
  g1(42,51)=(-(y(46)-y(47)));
  g1(43,38)=1;
  g1(43,41)=(-1);
  g1(43,42)=1;
  g1(44,40)=1;
  g1(44,41)=(-1);
  g1(44,43)=1;
  g1(45,37)=(-(1/y(37)));
  g1(45,44)=1;
  g1(46,37)=(-(1/y(37)));
  g1(46,45)=1;
  g1(47,37)=(-(1/y(37)));
  g1(47,46)=1;
  g1(48,47)=1;
  g1(49,14)=(-1);
  g1(49,24)=(-1);
  g1(49,48)=1;
  g1(50,49)=1-params(61);
  g1(51,36)=(-1);
  g1(51,50)=1;
  g1(52,52)=1;
  if ~isreal(g1)
    g1 = real(g1)+2*imag(g1);
  end
if nargout >= 3,
  %
  % Hessian matrix
  %

  g2 = sparse([],[],[],52,2704);
if nargout >= 4,
  %
  % Third order derivatives
  %

  g3 = sparse([],[],[],52,140608);
end
end
end
end
